<?php 
/**
*ajax响应,用于区域的显示
*/
require("./include/init.php");
date_default_timezone_set('Asia/Shanghai');
$act=$_POST['act'];
if($act=='getpro'){
	$pros= $_POST['province'];
	$sql="select * from area where area='" . $pros . "'";
	$mysql=mysql::getIns();
	$row=$mysql->getAll($sql);
	print_r($row);
	echo "<option>请选择省份</option>";
	foreach($row as $v){
		echo "<option>$v[pro]</option>";
	}
}else if($act=='getcitys'){
	$pros= $_POST['province'];
	$sql="select * from area where pro='" . $pros . "'";
	$mysql=mysql::getIns();
	$row=$mysql->getAll($sql);
	echo "<option>请选择城市</option>";
	foreach($row as $v){
		echo "<option>$v[city]</option>";
	}
	
}else if($act=='get4S'){
	$pros= $_POST['city'];
	$sql="select * from area where city='" . $pros . "'";
	$mysql=mysql::getIns();
	$row=$mysql->getAll($sql);
	echo "<option>请选择经销商</option>";
	foreach($row as $v){
		echo "<option>$v[areaname]</option>";
	}
	
}

?>